package org.dxy.domain.event.workorder;

import org.dxy.domain.event.AggregateTypeEnum;
import org.dxy.domain.event.DomainEvent;

/**
 * 工单数量变更事件
 * @author dxy
 */
public record WorkOrderQuantityChangedEvent(
        /** 工单ID */
        Long workOrderId,
        /** 工单编码 */
        String workOrderCode,
        /** 新数量 */
        Integer newQuantity
) implements DomainEvent {
    
    @Override
    public Long aggregateId() {
        return workOrderId;
    }

    @Override
    public String aggregateType() {
        return AggregateTypeEnum.WORK_ORDER.getKey();
    }
    
    @Override
    public String eventType() {
        return WorkOrderEventTypeEnum.QUANTITY_CHANGED.getKey();
    }

    /**
     * 获取工单事件类型枚举
     */
    public WorkOrderEventTypeEnum getWorkOrderEventType() {
        return WorkOrderEventTypeEnum.QUANTITY_CHANGED;
    }
}